Skip to content

Support configurable ALGORITHM and LOCK in generated migrations - #330

Merged
jongleb merged 1 commit into
ygrek:masterfrom
jongleb:online-ddl-migrs
Sep 22, 2026
Merged

jongleb merged 1 commit into
ygrek:masterfrom
jongleb:online-ddl-migrs

Conversation

@jongleb

@jongleb jongleb commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This PR adds configurable ALGORITHM and LOCK policies for generated migrations. Without these options, generated SQL remains unchanged and uses database defaults.

sqlgg -migrate \
  -alter-algorithm inplace \
  -alter-lock none \
  ...

Generated SQL:

ALTER TABLE `users`
  ADD INDEX `email_idx` (`email`),
  ALGORITHM=INPLACE,
  LOCK=NONE;

Manual migrations in extends.sql remain available for per-migration overrides.

@jongleb
jongleb force-pushed the online-ddl-migrs branch 2 times, most recently from cae1453 to bf132e5 Compare September 22, 2026 11:14
@jongleb jongleb changed the title Support online ddl in gen migrations Support configurable ALGORITHM and LOCK in generated migrations Sep 22, 2026
@jongleb jongleb changed the title Support configurable ALGORITHM and LOCK in generated migrations Support configurable ALGORITHM and LOCK in generated migrations Sep 22, 2026
@jongleb
jongleb marked this pull request as ready for review September 22, 2026 11:53
@jongleb
jongleb merged commit e4af941 into ygrek:master Sep 22, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant